/*
 * Created on 2004-2-12
 */
package nc.ui.xew.proaccept;

import java.util.HashMap;

import nc.ui.pub.bill.BillItem;
import nc.ui.pub.bill.BillModel;
import nc.vo.pub.CircularlyAccessibleValueObject;
import nc.vo.pub.formulaset.FormulaParseFather;
import nc.vo.pub.formulaset.VarryVO;

/**
 * Create datetime:(2004-2-12 9:19:45)
 * @author hxr
 */
class BillFormulaContext {
	//create hashtable props
	private FormulaParseFather formula = null;
	//common props
	private int[] rows = null;
	//BillItem editingItem = null;
	//One is required in the followed three variables
	private CircularlyAccessibleValueObject[] VOs = null;
	private BillModel billmodel = null;
	private HashMap<String,BillItem> billItemHash = null;
	private HashMap<String,Object> hashFormulas = null;
	//process result
	private VarryVO varry = null;
	private String[] result = null;
	//result state
	private boolean execNormal = true;
	final static int FORMULATYPE_EDIT = 0;
	final static int FORMULATYPE_LOAD = 1;
	final static int FORMULATYPE_VALIDATE = 2;
	final static int FORMULATYPE_VO = 3;
	final static int FORMULATYPE_OTHER = -1;
	//formula type
	private int formulaType;
	public BillFormulaContext(int formulaType) {
		this.formulaType = formulaType;
	}
	/**
	 * @return Returns the billmodel.
	 */
	public BillModel getBillmodel() {
		return billmodel;
	}
	/**
	 * @param billmodel The billmodel to set.
	 */
	public void setBillmodel(BillModel billmodel) {
		this.billmodel = billmodel;
	}
	/**
	 * @return Returns the formula.
	 */
	public FormulaParseFather getFormula() {
		return formula;
	}
	/**
	 * @param formula The formula to set.
	 */
	public void setFormula(FormulaParseFather formula) {
		this.formula = formula;
	}
	/**
	 * @return Returns the vOs.
	 */
	public CircularlyAccessibleValueObject[] getVOs() {
		return VOs;
	}
	/**
	 * @param os The vOs to set.
	 */
	public void setVOs(CircularlyAccessibleValueObject[] os) {
		VOs = os;
	}
	/**
	 * @return Returns the result.
	 */
	public String[] getResult() {
		return result;
	}
	/**
	 * @param result The result to set.
	 */
	public void setResult(String[] result) {
		this.result = result;
	}
	/**
	 * @return Returns the varry.
	 */
	public VarryVO getVarry() {
		return varry;
	}
	/**
	 * @param varry The varry to set.
	 */
	public void setVarry(VarryVO varry) {
		this.varry = varry;
	}
	/**
	 * @return Returns the execNormal.
	 */
	public boolean isExecNormal() {
		return execNormal;
	}
	/**
	 * @param execNormal The execNormal to set.
	 */
	public void setExecNormal(boolean execNormal) {
		this.execNormal = execNormal;
	}
	/**
	 * @return Returns the billItemHash.
	 */
	HashMap<String,BillItem> getBillItemHash() {
		return billItemHash;
	}
	/**
	 * @param billItemHash The billItemHash to set.
	 */
	void setBillItemHash(HashMap<String,BillItem> billItemHash) {
		this.billItemHash = billItemHash;
	}
	/**
	 * @return Returns the rows.
	 */
	int[] getRows() {
		return rows;
	}
	/**
	 * @param rows The rows to set.
	 */
	void setRows(int[] rows) {
		this.rows = rows;
	}
	public int getFormulaType() {
		return formulaType;
	}
	public void setFormulaType(int formulaType) {
		this.formulaType = formulaType;
	}
	public HashMap<String,Object> getHashFormulas() {
		if(hashFormulas == null)
			hashFormulas = new HashMap<String,Object>();
		return hashFormulas;
	}
	public void setHashFormulas(HashMap<String,Object> hashFormulas) {
		this.hashFormulas = hashFormulas;
	}
}
